import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from "../views/index/Index.vue"

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect:"/home"
  },
  {
    path:"/index",
    name: 'index',
    redirect:"/home",
    component: Index,
    children:[
      {
        path: '/home',
        name: 'home',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () => import(/* webpackChunkName: "home" */ '../views/home/home.vue')
      },
      {
        path: '/news',
        name: 'news',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () => import(/* webpackChunkName: "news" */ '../views/news/news.vue')
      },
      {
        path: '/about',
        name: 'about',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () => import(/* webpackChunkName: "about" */ '../views/about/about.vue')
      },
      {
        path: '/web',
        name: 'h5',
        redirect:"/h5",
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () => import(/* webpackChunkName: "h5" */ '../views/h5/h5.vue'),
        children:[
          {
            path: '/h5',
            name: 'H5',
            // route level code-splitting
            // this generates a separate chunk (about.[hash].js) for this route
            // which is lazy-loaded when the route is visited.
            component: () => import(/* webpackChunkName: "h5" */ '../views/h5/hh5/h5.vue'),
          },
          {
            path: '/python',
            name: 'Python',
            // route level code-splitting
            // this generates a separate chunk (about.[hash].js) for this route
            // which is lazy-loaded when the route is visited.
            component: () => import(/* webpackChunkName: "job" */ '../views/h5/python/Python.vue')
          },
          {
            path: '/ui',
            name: 'UI',
            // route level code-splitting
            // this generates a separate chunk (about.[hash].js) for this route
            // which is lazy-loaded when the route is visited.
            component: () => import(/* webpackChunkName: "job" */ '../views/h5/ui.vue')
          },
          {
            path: '/java',
            name: 'Java',
            // route level code-splitting
            // this generates a separate chunk (about.[hash].js) for this route
            // which is lazy-loaded when the route is visited.
            component: () => import(/* webpackChunkName: "job" */ '../views/h5/java/java.vue')
          },
        ]
      },
      
      {
        path: '/teachers',
        name: 'teachers',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () => import(/* webpackChunkName: "teachers" */ '../views/teachers/teachers.vue')
      },
      {
        path: '/cooperation',
        name: 'cooperation',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () => import(/* webpackChunkName: "cooperation" */ '../views/cooperation/cooperation.vue')
      },
      {
        path: '/school',
        name: 'school',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () => import(/* webpackChunkName: "school" */ '../views/school/school.vue')
      },
      {
        path: '/works',
        name: 'works',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () => import(/* webpackChunkName: "works" */ '../views/works/works.vue')
      },
      {
        path: '/job',
        name: 'job',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () => import(/* webpackChunkName: "job" */ '../views/job/job.vue')
      },
      
    ]
  }
 
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
